﻿#include "stdafx.h"
#include "functions.h"




CORE_API void Messg(const char* m)
{
	MessageBoxA(0, m, "MyLearnEnglish :    Message", MB_OK | MB_APPLMODAL | MB_TASKMODAL);
}

CORE_API void HandleError(const char* srcfile, const int srcline, const char* msg)
{
	Messg("ERROR !!!!");
}

const DWORD MBOXERR_FLAGS = MB_OK | MB_ICONERROR | MB_TOPMOST | MB_APPLMODAL | MB_TASKMODAL;

CORE_API void MessageError(const char* msg)
{
	MessageBoxA(0, msg, "MyLearnEnglish :    Ошибка !", MBOXERR_FLAGS);
}

CORE_API void MessageError(const std::string& msg)
{
	MessageBoxA(0, msg.c_str(), "MyLearnEnglish :    Ошибка !", MBOXERR_FLAGS);
}

CORE_API void MessageError(const std::wstring& msg)
{
	MessageBoxW(0, msg.c_str(), L"MyLearnEnglish :    Ошибка !", MBOXERR_FLAGS);
}

CORE_API void MessageInfo(const char* msg)
{
	MessageBoxA(0, msg, "MyLearnEnglish :    Информация", MB_OK | MB_ICONINFORMATION | MB_TOPMOST | MB_APPLMODAL | MB_TASKMODAL);
}


CORE_API bool MessageAsk(const char* msg)
{
	int temp = MessageBoxA(0, msg, "MyLearnEnglish :    Запрос на подтверждение", MB_YESNO | MB_ICONWARNING | MB_TOPMOST | MB_APPLMODAL | MB_TASKMODAL);

	if(temp == 6)
	{
		return true;
	}

	return false;
}



class ____Ininialize_functions_cpp
{
public:

	____Ininialize_functions_cpp()
	{
		// test
		//bool temp = MessageAsk("Чего ?");

	}

	~____Ininialize_functions_cpp()
	{

	}

};	 static  ____Ininialize_functions_cpp  ______Ininialize_functions_cpp;





